Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rdlc.naming
Class QualifiedIdentifier<V>

    java.lang.Object
      rdlc.naming.QualifiedIdentifier<V>

Direct Known Subclasses:
  Instance.QualifiedIdentifier, Namespace.QualifiedIdentifier

    public abstract class QualifiedIdentifier<V>

extends java.lang.Object

This class abstracts a (fully) qualified identifier within a naming hierarchy constructed from `HierarchicalCatalog`s. The difference between this and an `Identifier` is that a qualified identifier might have been declared in a catalog other than the one in which it names a value. Thus it can include a full path.

Version:
  $Revision: 1.11 $
Author:
  Greg Gibeling

Field Summary
`protected Accessor<V>` | `accessor` The `Accessor` which we use to traverse the naming hierarchy.
`protected Identifier<V>` | `cachedValue` The cached value which this identifier names.
`protected java.lang.Object` | `catalog` The catalog which this identifier is relative to.
`protected java.util.List<java.lang.String>` | `lName` A list of names which together form a complete path.
`protected int` | `parentCount` The number of parent references prefixed to this path.

Constructor Summary
`protected` | `QualifiedIdentifier(java.lang.Object _catalog, Accessor<V> _accessor, java.util.List<java.lang.String> _lName, int _parentCount)` Base constructor, simply records all it's arguments, and sets the `cachedValue` to `null`.
`protected` | `QualifiedIdentifier(java.lang.Object _catalog, Identifier<V> _identifier)` Create a qualified identifier which names the same value as the given identifier, but relative to the given catalog.

Method Summary
`HierarchicalCatalog<V>` | `getCatalog()` Get the catalog in which this identifier was first declared with it's qualified name.
`java.lang.String` | `getComplete(java.lang.String separator, boolean rootSeparator, java.lang.String atSeparator)` Get the path and name for this identifier combined.
`java.util.List<java.lang.String>` | `getName()` Simple accessor.
`java.lang.String` | `getName(java.lang.String separator)` Get the relative name for this identifier.
`java.lang.String` | `getName(java.lang.String separator, java.lang.String parentName)` Get the relative name for this identifier.
`java.lang.String` | `getPath(java.lang.String separator, boolean rootSeparator)` Get the relative path for this identifier.
`boolean` | `isSimple()` Determine if this is a simple qualified identifier, one which does not actually contain a path.
`Identifier<V>` | `resolve(Log errorLog, Expression.Phase phase)` Resolve this qualfied identifier.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### catalog

    protected java.lang.Object catalog

  The catalog which this identifier is relative to. This might not be the catalog in which this identifier's value is bound.

### accessor

    protected Accessor<V> accessor

  The `Accessor` which we use to traverse the naming hierarchy.

### lName

    protected java.util.List<java.lang.String> lName

  A list of names which together form a complete path. Does not include any parent references.

  See Also:
    `parentCount`

### parentCount

    protected int parentCount

  The number of parent references prefixed to this path. This is used instead of storing ".." in a UNIX path name, because this class is path separator agnostic. The value `-1` is used to indicate a rooted path.

### cachedValue

    protected Identifier<V> cachedValue

  The cached value which this identifier names.

Constructor Detail

### QualifiedIdentifier

    protected QualifiedIdentifier(java.lang.Object _catalog,
                                  Accessor<V> _accessor,
                                  java.util.List<java.lang.String> _lName,
                                  int _parentCount)

  Base constructor, simply records all it's arguments, and sets the `cachedValue` to `null`.

  Parameters:
    `_catalog` - The catalog which this identifier should be relative to.
    `_accessor` - The `Accessor` to use to traverse the naming hierarchy.
    `_lName` - A list of strings, which form the path.
    `_parentCount` - The number of parent references to prefix to `_lName`. `-1` to indicate this is a rooted path.

### QualifiedIdentifier

    protected QualifiedIdentifier(java.lang.Object _catalog,
                                  Identifier<V> _identifier)

  Create a qualified identifier which names the same value as the given identifier, but relative to the given catalog. This is used in constructing relative identifiers.

  Parameters:
    `_catalog` - The catalog which this qualified identifier should be relative to.
    `_identifier` - An identifier which names the object we should name.
  See Also:
    `Identifier.getRelative(Object)`

Method Detail

### getName

    public java.util.List<java.lang.String> getName()

  Simple accessor.

  Returns:
    The list of strings representing the path for this qualified identifier.

### getName

    public java.lang.String getName(java.lang.String separator)

  Get the relative name for this identifier. This is most likely the name that was specified when the identifier was created. It will include prefix references to parent catalogs starting from the catalog where this identifier was specified. This name will be relative to the path returned by `getPath(String)`. In this representation, the parent references will simple be a count, as in RDL style names. For file system style names, use `getName(String, String)`.

  Parameters:
    `separator` - The separator to insert between path components ("::" for statics).
  Returns:
    A relative path name which was given to this identifier.
  See Also:
    `getName(String, String)`, `getPath(String, boolean)`, `getCatalog()`

### getName

    public java.lang.String getName(java.lang.String separator,
                                    java.lang.String parentName)

  Get the relative name for this identifier. This is most likely the name that was specified when the identifier was created. It will include prefix references to parent catalogs starting from the catalog where this identifier was specified. This name will be relative to the path returned by `getPath(String)`. In this representation, the parent references will be named used the `parentName` in keeping with UNIX and DOS file system style names.

  Parameters:
    `separator` - The separator to insert between path components ("::" for statics).
  Returns:
    A relative path name which was given to this identifier.
  See Also:
    `getName(String)`, `getPath(String, boolean)`, `getCatalog()`

### getPath

    public java.lang.String getPath(java.lang.String separator,
                                    boolean rootSeparator)

  Get the relative path for this identifier. This is most likely the path to the catalog where the identifier was first declared. This will specify the catalog wherein the named returned by `getName()` should be resolved. It will also name the catalog returned by `getCatalog()`.

  Parameters:
    `separator` - The separator to insert between path components ("::" for statics).
    `rootSeparator` - `true` indicates the root is denoted with a leading separator.
  Returns:
    A relative path name which was given to this identifier.
  See Also:
    `getName(String)`, `getName(String, String)`, `getCatalog()`

### getComplete

    public java.lang.String getComplete(java.lang.String separator,
                                        boolean rootSeparator,
                                        java.lang.String atSeparator)

  Get the path and name for this identifier combined. This will include the values returned by `getName()` and `getPath()` in that order.

  Parameters:
    `separator` - The separator to insert between path components ("::" for statics).
    `rootSeparator` - `true` indicates the root is denoted with a leading separator.
    `atSeparator` - The separator to use between the qualified name and the path.
  Returns:
    A fully qualified path.
  See Also:
    `getName()`, `getPath(String, boolean)`

### getCatalog

    public HierarchicalCatalog<V> getCatalog()

  Get the catalog in which this identifier was first declared with it's qualified name. This will be catalog in which the string returned by `getName()` should be resolved. It will be the catalog named by `getPath()`.

  Returns:
    This identifier's relative parent catalog.
  See Also:
    `getName(String)`, `getName(String, String)`, `getPath(String, boolean)`

### resolve

    public Identifier<V> resolve(Log errorLog,
                                 Expression.Phase phase)

  Resolve this qualfied identifier. At the end of this the can generate an `Identifier` which names the same value as this one, except without the complexity of hanving a path in the way.

  Parameters:
    `errorLog` - Log of errors to be reported to the user.
    `phase` - The phase of resolution to perform.
  Returns:
    An `Identifier` which names the same value as this one. `null` if for any reason this identifier cannot be resolved.

### isSimple

    public boolean isSimple()

  Determine if this is a simple qualified identifier, one which does not actually contain a path.

  Returns:
    `true` if this is a simply qualified identifier.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD